home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
PROGEDIT
/
3458B.ZIP
/
AMAC44B.ZIP
/
SZ.BAT
< prev
next >
Wrap
DOS Batch File
|
1992-06-22
|
3KB
|
107 lines
:SZ.BAT Search ZIP Files , Can Remove Text From Zip Files 4/17/92
:
:1) SYNTAX: SZ.BAT %1 %2
: ┌──────────┘ │
: (Mode) %1 %2
: Search Text ZIP Name
: ---------------- ------------- --------
: a) Query [ ] [ ]
: b) Partial Query Search Text [ ]
: e) All command line Search Text ZIP Name
:
:
: where: %1 - Search Text
: %2 - ZIP Name, no extension
:
: [ ] - entered at query prompt
:2) Requires FGREP.COM INPUT.COM DX.EXE PKUNZIP.EXE
: SRL.MAC
:
:*******************************************************************************
:* Environment Variable Action *
:* --------------------------- ----------------------------------------------- *
:* set srmac= macro files are located in current directory *
:* set srmac=c:\mac\ macro files are located in c:\mac\ directory *
:* set sztemp= uses default c:\$zip$ for temporary directory *
:* set sztemp=e:\name uses e:\name for temporary directory *
:*******************************************************************************
:
@echo OFF
cls
set S~~=%1
set file=%2
break on
if "%sztemp%" == "" set sztemp= c:\$zip$
if "%1" == "" echo Search Text: [{Blank} terminates batch file]
if not "%1" == "" goto 2b
INPUT.COM Search Text=/b
if errorlevel=1 goto 6a
set S~~=%ans%
goto 2a
:1a
echo Search Text=%S~~%
:2a
:2b
set ans=
if not "%2" == "" goto 2c
echo ZIP Name(s): [ZIP Name(s), no ZIP extn] [{Blank} terminates batch file]
INPUT.COM ZIP Name=/b
if errorlevel=1 goto 6a
set file=%ans%
:2c
if "%file%" == "" goto 6a
if not exist %file%.ZIP goto 6a
:4a
CLS
echo Search Text = %S~~%
echo ZIP Name = %file%.ZIP
if not exist %sztemp%\nul md %sztemp%
PKUNZIP.EXE -o %file% %sztemp%
echo.
DX.EXE %sztemp% //v-/fattr:!a-/he:1/st:1/out:nul
DX.EXE %sztemp%\*.exe *.com *.zip *.mac *.arc//v-/del/he:1/st:1/out:nul
echo.
FGREP.COM -fl %S~~% %sztemp%\*.* >c:\$.ql
set >c:\$
copy c:\$.ql c:\!
Q.EXE C:\! /E%srmac%SRL.MAC /L%srmac%SRL.MAC
echo.
echo.
echo Deleting temporary files and removing temporary directory %sztemp% . . .
echo y | erase %sztemp%\*.* >nul
rd %sztemp%
if exist %sztemp%\nul echo Directory %sztemp% still exists . . .
erase c:\!
erase c:\$.*
goto 7a
:6a
echo.
if "%S~~%" == "" echo Must specify Search Text . . . .
if not exist %file%.zip echo Can't Find ZIP_File %file%.ZIP . . . .
if "%file%" == "" echo Must Specify ZIP_File . . . .
echo Search──INCOMPLETE──
goto 8a
:7a
echo.
echo Search──Complete──
:8a
echo.
break off
echo.